%tr[esr_record]{:class => esr_record.state}
  %td= esr_record.value_date
  %td= link_to esr_record.invoice.customer.to_s, esr_record.invoice.customer if esr_record.invoice
  %td= esr_record.invoice ? link_to(esr_record.remarks, esr_record.invoice) : esr_record.remarks
  %td.currency= currency_fmt(esr_record.invoice.amount.currency_round) if esr_record.invoice
  %td.currency= currency_fmt(esr_record.amount.currency_round)
  %td.currency= currency_fmt(esr_record.invoice.balance.currency_round) if esr_record.invoice
  %td.action-links
    - esr_record.aasm.events.each do |event|
      = link_to event_image(event.name), polymorphic_url([event.name, esr_record]), :remote => true, :method => :post, :title => t_action(event.name)
